LearningStoreHelper.Cast<T> Method (object, out T?)

Converts a value returned from a LearningStore query to a given type, or null if the value is DBNull.

Parent Type: LearningStoreHelper

Namespace: Microsoft.SharePointLearningKit

Assembly: Microsoft.SharePointLearningKit.dll

Syntax
C#

public static void Cast<T> (
object value,
out T? result

)

where T : struct

Type Parameters

T

The type to convert to.

Parameters

value

A value from a DataRow within a DataTable returned from a LearningStore query.

result

Where to store the result. value is cast to the type of result, or is set to null if value is DBNull.

Remarks

This version of Cast is used to retrieve a value type from LearningStore, i.e. bool, DateTime, float, double, Guid, int, or an enumerated type. The output parameter must be a nullable type; if the input value is the database "NULL" value, then null is stored in the output parameter.